package com.example.dataextraction.model;

import com.example.dataextraction.model.BaseBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel(value = "数据源配置信息")
public class DataSource extends BaseBean<DataSource> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数据库IP", example = "localhost", required = true)
    @NotNull(message = "fromDataSourceCode不能为空")//空校验
    @NotBlank //不能为空字符串
    private String ip;

    @ApiModelProperty(value = "数据源编码", example = "dataSourceCode", required = true)
    @NotNull(message = "数据源编码不能为空")//空校验
    @NotBlank //不能为空字符串
    private String dataSourceCode;

    @ApiModelProperty(value = "数据源名称", example = "dataSourceName", required = true)
    @NotNull(message = "数据源名称不能为空")//空校验
    @NotBlank //不能为空字符串
    private String dataSourceName;

    @ApiModelProperty(value = "端口", example = "3306", required = true)
    @NotNull(message = "fromDataSourceCode不能为空")//空校验
    @NotBlank //不能为空字符串
    private String port;

    @ApiModelProperty(value = "数据库连接URL", example = "jdbc:mysql://localhost:3306/dc?useUnicode=true&characterEncoding=UTF-8", required = true)
    @NotNull(message = "fromDataSourceCode不能为空")//空校验
    @NotBlank //不能为空字符串
    private String url;// 数据库连接URL

    @ApiModelProperty(value = "数据库连接用户名", example = "root", required = true)
    @NotNull(message = "fromDataSourceCode不能为空")//空校验
    @NotBlank //不能为空字符串
    private String username;// 数据库连接用户名

    @ApiModelProperty(value = "用户信息密码", example = "123456", required = true)
    @NotNull(message = "fromDataSourceCode不能为空")//空校验
    @NotBlank //不能为空字符串
    private String password;// 用户信息密码

    @ApiModelProperty(value = "驱动", example = "com.mysql.jdbc.Driver", required = true)
    @NotNull(message = "fromDataSourceCode不能为空")//空校验
    @NotBlank //不能为空字符串
    private String driver;// 驱动

    private String serviceName;

    public String getDataSourceCode() {
        return dataSourceCode;
    }

    public void setDataSourceCode(String dataSourceCode) {
        this.dataSourceCode = dataSourceCode;
    }

    public String getDataSourceName() {
        return dataSourceName;
    }

    public void setDataSourceName(String dataSourceName) {
        this.dataSourceName = dataSourceName;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

}
